from plotter import compile_from_str, compile_from_file, plot, plot2


def normal_test():
    points = compile_from_file('correct.src')
    plot2(points, reset=True)


def error_test():
    srcs = [
        'rot is 1$1;',  # ERROR_WRONG_TOKEN
        'rot is ((1+ 2 + 3);',  # ERROR_UNMATCHED_BRACKETS
        'rot is 1 +/ 2;',  # ERROR_WRONG_EXPRESSION
        'for t is;',  # ERROR_WRONG_SYNTAX
        'scale is );',
        'scale is san(0);'
    ]
    for src in srcs:
        try:
            points = compile_from_str(src)
        except Exception as e:
            print(e)


if __name__ == '__main__':
    # normal_test()
    error_test()
    input()
